ci: Use result instead of exit code in the JUnit report
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 13 Feb 2020 13:56:33 +0000 (13:56 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 13 Feb 2020 14:55:39 +0000 (14:55 +0000)
We have a result code coming from Meson which is more accurate than just
looking at the exit code of the unit.

.gitlab-ci/meson-junit-report.py

index 248ef6e2b1d0be92b2d3b1a7f957718e61ece4aa..f63c82eb36a2b1732c6eec9ab4b9006c8a739e72 100755 (executable)
@@ -51,6 +51,7 @@ for line in args.infile:
 
     duration = data['duration']
     return_code = data['returncode']
+    result = data['result']
     log = data['stdout']
 
     unit = {
@@ -58,6 +59,7 @@ for line in args.infile:
         'name': unit_name,
         'duration': duration,
         'returncode': return_code,
+        'result': result,
         'stdout': log,
     }
 
@@ -68,12 +70,12 @@ for name, units in suites.items():
     print('Processing suite {} (units: {})'.format(name, len(units)))
 
     def if_failed(unit):
-        if unit['returncode'] != 0:
+        if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
             return True
         return False
 
     def if_succeded(unit):
-        if unit['returncode'] == 0:
+        if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
             return True
         return False